# Copyright (C) 2006 International Business Machines and others.
# All Rights Reserved.
# This file is distributed under the Eclipse Public License.

## $Id: Makefile.am 2666 2016-07-20 16:02:55Z stefan $

# Author:  Andreas Waechter           IBM    2006-04-13

AUTOMAKE_OPTIONS = foreign

########################################################################
#                      unitTest for CoinUtils                          #
########################################################################

noinst_PROGRAMS = hs071_cpp hs071_c

if COIN_HAS_F77
noinst_PROGRAMS += hs071_f
endif

nodist_hs071_cpp_SOURCES = hs071_main.cpp hs071_nlp.cpp hs071_nlp.hpp
hs071_cpp_LDADD = ../src/Interfaces/libipopt.la $(IPOPTLIB_LIBS)
hs071_cpp_DEPENDENCIES = ../src/Interfaces/libipopt.la $(IPOPTLIB_DEPENDENCIES)

nodist_hs071_c_SOURCES = hs071_c.c
hs071_c_LDADD = ../src/Interfaces/libipopt.la $(IPOPTLIB_LIBS) $(CXXLIBS)
hs071_c_DEPENDENCIES = ../src/Interfaces/libipopt.la $(IPOPTLIB_DEPENDENCIES)

nodist_hs071_f_SOURCES = hs071_f.f
hs071_f_LDADD = ../src/Interfaces/libipopt.la $(IPOPTLIB_LIBS) $(CXXLIBS)
hs071_f_DEPENDENCIES = ../src/Interfaces/libipopt.la $(IPOPTLIB_DEPENDENCIES)

# Here list all include flags, relative to this "srcdir" directory.  This
# "cygpath" stuff is necessary to compile with native compilers on Cygwin
AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../src/Common` \
	-I`$(CYGPATH_W) $(srcdir)/../src/LinAlg` \
	-I`$(CYGPATH_W) $(srcdir)/../src/LinAlg/TMatrices` \
	-I`$(CYGPATH_W) $(srcdir)/../src/Algorithm` \
	-I`$(CYGPATH_W) $(srcdir)/../src/Interfaces`

AM_FFLAGS = -I`$(CYGPATH_W) $(srcdir)/../src/Interfaces`

# This line is necessary to allow VPATH compilation
DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src/Common

hs071_f.f:
	$(LN_S) ../examples/hs071_f/$@ $@

if COIN_HAS_F77
test: hs071_cpp$(EXEEXT) hs071_c$(EXEEXT) hs071_f$(EXEEXT)
else
test: hs071_cpp$(EXEEXT) hs071_c$(EXEEXT)
endif
	chmod u+x ./run_unitTests
	./run_unitTests

unitTest: test

.PHONY: test uniTest

########################################################################
#                          Cleaning stuff                              #
########################################################################

# Here we list everything that is not generated by the compiler, e.g.,
# output files of a program

DISTCLEANFILES = hs071_f.f
